import request from '@/utils/request'

// 获取社团下拉框列表
export function getClubSelectList(data) {
  return request({
    url: '/api/club/selected/club_name/',
    method: 'get',
    params: data
  })
}

// 根据权限获取社团下拉框列表
export function getClubSelectListByPerm(data) {
  return request({
    url: '/api/club/perm_club/',
    method: 'get',
    params: data
  })
}

// 获取所有已通过的社团
export function getClubList(data) {
  return request({
    url: '/api/club/',
    method: 'get',
    params: data
  })
}

// 获取我有权限管理的社团
export function getMyClubList(data) {
  return request({
    url: '/api/club/myclub/',
    method: 'get',
    params: data
  })
}

// 获取社团详情(全部人都可以看)
export function getClubDetail(id, data) {
  return request({
    url: '/api/club/' + id + '/',
    method: 'get',
    params: data
  })
}

// 获取社团详情(包括审核文件等)
export function getClubDetailByPerm(id, data) {
  return request({
    url: '/api/club/' + id + '/whole/',
    method: 'get',
    params: data
  })
}

// 设置社团招新时间
export function setClubTime(data) {
  return request({
    url: '/api/club/application_time/',
    method: 'post',
    headers: {
      'Content-Type': 'application/json'
    },
    data: data
  })
}

// 创建社团
export function createClub(data) {
  return request({
    url: '/api/club/',
    method: 'post',
    headers: {
      'Content-Type': 'application/json'
    },
    data: data
  })
}

// 更新社团
export function updateClub(id, data) {
  return request({
    url: '/api/club/' + id + '/',
    method: 'patch',
    headers: {
      'Content-Type': 'application/json'
    },
    data: data
  })
}

// 获取社团成立一级审核列表
export function getFirstCheckCreateClub(data) {
  return request({
    url: '/api/club/first_check_list/',
    method: 'get',
    params: data
  })
}

// 获取社团成立二级审核列表
export function getSecondCheckCreateClub(data) {
  return request({
    url: '/api/club/second_check_list/',
    method: 'get',
    params: data
  })
}

// 进行一级审核
export function firstCheckCreateClub(id, data) {
  return request({
    url: '/api/club/' + id + '/first_check/',
    method: 'post',
    headers: {
      'Content-Type': 'application/json'
    },
    data: data
  })
}

// 进行二级审核
export function secondCheckCreateClub(id, data) {
  return request({
    url: '/api/club/' + id + '/second_check/',
    method: 'post',
    headers: {
      'Content-Type': 'application/json'
    },
    data: data
  })
}

// 更换社团指导老师
export function changeClubTeacher(id, data) {
  return request({
    url: '/api/club/' + id + '/change_teacher/',
    method: 'post',
    headers: {
      'Content-Type': 'application/json'
    },
    data: data
  })
}
